Optimal. Leaf size=129 \[ \frac{x \left (-3 i c^2 d+c^3+3 c d^2+3 i d^3\right )}{2 a}-\frac{d^2 (c+3 i d) \tan (e+f x)}{2 a f}+\frac{d^2 (-d+3 i c) \log (\cos (e+f x))}{a f}+\frac{(-d+i c) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.155703, antiderivative size = 129, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.107, Rules used = {3550, 3525, 3475} \[ \frac{x \left (-3 i c^2 d+c^3+3 c d^2+3 i d^3\right )}{2 a}-\frac{d^2 (c+3 i d) \tan (e+f x)}{2 a f}+\frac{d^2 (-d+3 i c) \log (\cos (e+f x))}{a f}+\frac{(-d+i c) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3550
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int \frac{(c+d \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx &=\frac{(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}+\frac{\int (c+d \tan (e+f x)) \left (a \left (c^2-3 i c d+2 d^2\right )-a (c+3 i d) d \tan (e+f x)\right ) \, dx}{2 a^2}\\ &=\frac{\left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) x}{2 a}-\frac{(c+3 i d) d^2 \tan (e+f x)}{2 a f}+\frac{(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}-\frac{\left ((3 i c-d) d^2\right ) \int \tan (e+f x) \, dx}{a}\\ &=\frac{\left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) x}{2 a}+\frac{(3 i c-d) d^2 \log (\cos (e+f x))}{a f}-\frac{(c+3 i d) d^2 \tan (e+f x)}{2 a f}+\frac{(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}\\ \end{align*}
Mathematica [A] time = 2.47152, size = 236, normalized size = 1.83 \[ \frac{\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (2 f x \left (-3 i c^2 d+c^3+3 c d^2+3 i d^3\right ) (\cos (e)+i \sin (e))-4 d^2 f x (3 c+i d) (\cos (e)+i \sin (e))+2 i d^2 (3 c+i d) (\cos (e)+i \sin (e)) \log \left (\cos ^2(e+f x)\right )+4 d^2 (3 c+i d) (\cos (e)+i \sin (e)) \tan ^{-1}(\tan (f x))+(c+i d)^3 (\sin (e)+i \cos (e)) \cos (2 f x)+(c+i d)^3 (\cos (e)-i \sin (e)) \sin (2 f x)+4 d^3 (\tan (e)-i) \sin (f x) \sec (e+f x)\right )}{4 f (a+i a \tan (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.03, size = 288, normalized size = 2.2 \begin{align*}{\frac{-i{d}^{3}\tan \left ( fx+e \right ) }{af}}-{\frac{3\,\ln \left ( \tan \left ( fx+e \right ) -i \right ){c}^{2}d}{4\,af}}+{\frac{5\,\ln \left ( \tan \left ( fx+e \right ) -i \right ){d}^{3}}{4\,af}}-{\frac{{\frac{i}{4}}\ln \left ( \tan \left ( fx+e \right ) -i \right ){c}^{3}}{af}}-{\frac{{\frac{9\,i}{4}}\ln \left ( \tan \left ( fx+e \right ) -i \right ) c{d}^{2}}{af}}+{\frac{{\frac{3\,i}{2}}{c}^{2}d}{af \left ( \tan \left ( fx+e \right ) -i \right ) }}-{\frac{{\frac{i}{2}}{d}^{3}}{af \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{{c}^{3}}{2\,af \left ( \tan \left ( fx+e \right ) -i \right ) }}-{\frac{3\,c{d}^{2}}{2\,af \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{3\,\ln \left ( \tan \left ( fx+e \right ) +i \right ){c}^{2}d}{4\,af}}-{\frac{\ln \left ( \tan \left ( fx+e \right ) +i \right ){d}^{3}}{4\,af}}+{\frac{{\frac{i}{4}}\ln \left ( \tan \left ( fx+e \right ) +i \right ){c}^{3}}{af}}-{\frac{{\frac{3\,i}{4}}\ln \left ( \tan \left ( fx+e \right ) +i \right ) c{d}^{2}}{af}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.70215, size = 518, normalized size = 4.02 \begin{align*} \frac{{\left (2 \, c^{3} - 6 i \, c^{2} d + 18 \, c d^{2} + 10 i \, d^{3}\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + i \, c^{3} - 3 \, c^{2} d - 3 i \, c d^{2} + d^{3} +{\left (i \, c^{3} - 3 \, c^{2} d - 3 i \, c d^{2} + 9 \, d^{3} +{\left (2 \, c^{3} - 6 i \, c^{2} d + 18 \, c d^{2} + 10 i \, d^{3}\right )} f x\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - 4 \,{\left ({\left (-3 i \, c d^{2} + d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (-3 i \, c d^{2} + d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{4 \,{\left (a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 4.08401, size = 282, normalized size = 2.19 \begin{align*} \frac{2 d^{3} e^{- 2 i e}}{a f \left (e^{2 i f x} + e^{- 2 i e}\right )} + \frac{d^{2} \left (3 i c - d\right ) \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} + \frac{\left (\begin{cases} c^{3} x e^{2 i e} + \frac{i c^{3} e^{- 2 i f x}}{2 f} - 3 i c^{2} d x e^{2 i e} - \frac{3 c^{2} d e^{- 2 i f x}}{2 f} + 9 c d^{2} x e^{2 i e} - \frac{3 i c d^{2} e^{- 2 i f x}}{2 f} + 5 i d^{3} x e^{2 i e} + \frac{d^{3} e^{- 2 i f x}}{2 f} & \text{for}\: f \neq 0 \\x \left (c^{3} e^{2 i e} + c^{3} - 3 i c^{2} d e^{2 i e} + 3 i c^{2} d + 9 c d^{2} e^{2 i e} - 3 c d^{2} + 5 i d^{3} e^{2 i e} - i d^{3}\right ) & \text{otherwise} \end{cases}\right ) e^{- 2 i e}}{2 a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 2.02843, size = 251, normalized size = 1.95 \begin{align*} -\frac{\frac{4 i \, d^{3} \tan \left (f x + e\right )}{a} - \frac{{\left (i \, c^{3} + 3 \, c^{2} d - 3 i \, c d^{2} - d^{3}\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a} + \frac{{\left (i \, c^{3} + 3 \, c^{2} d + 9 i \, c d^{2} - 5 \, d^{3}\right )} \log \left (-i \, \tan \left (f x + e\right ) - 1\right )}{a} + \frac{-i \, c^{3} \tan \left (f x + e\right ) - 3 \, c^{2} d \tan \left (f x + e\right ) - 9 i \, c d^{2} \tan \left (f x + e\right ) + 5 \, d^{3} \tan \left (f x + e\right ) - 3 \, c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} - 3 i \, d^{3}}{a{\left (\tan \left (f x + e\right ) - i\right )}}}{4 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]